package top.jiangqiang.qyblog.core.service;

import top.jiangqiang.qyblog.common.base.query.PageResult;
import top.jiangqiang.qyblog.common.base.response.Result;
import top.jiangqiang.qyblog.core.base.service.BaseService;
import top.jiangqiang.qyblog.core.domain.dto.CategoryAddDto;
import top.jiangqiang.qyblog.core.domain.dto.CategoryQueryDto;
import top.jiangqiang.qyblog.core.domain.dto.CategoryUpdateDto;
import top.jiangqiang.qyblog.core.domain.entity.Category;
import top.jiangqiang.qyblog.core.domain.vo.CategoryVo;

/**
 * <p>
 * 文章分类 服务类
 * </p>
 *
 * @author JiangQiang
 * @since 2023-05-29
 */
public interface ICategoryService extends BaseService<Category> {

    Result<PageResult<CategoryVo>> findByCondition(CategoryQueryDto categoryQueryDto);

    Result<CategoryVo> saveCategory(CategoryAddDto categoryAddDto);

    Result<CategoryVo> editCategory(CategoryUpdateDto categoryUpdateDto);

    /**
     * 删除分类，子分类以及关联关系
     *
     * @param id 主键
     * @return
     */
    Result<Boolean> deleteCategory(Long id);

    Result<CategoryVo> getCategory(Long id);

    CategoryVo getCategoryByCategoryName(String categoryName);

    Long saveCategory(String categoryName);
}
